package analysis.bean.value;

import common.KPIType;
import org.apache.hadoop.io.MapWritable;
import org.apache.hadoop.io.WritableUtils;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class OutputMap extends StatsOutputValue {
    public KPIType type;
    public MapWritable map = new MapWritable();

    @Override
    public void write(DataOutput dataOutput) throws IOException {
        WritableUtils.writeEnum(dataOutput,type);
        this.map.write(dataOutput);
    }

    @Override
    public void readFields(DataInput dataInput) throws IOException {
        WritableUtils.readEnum(dataInput,KPIType.class);
        this.map.readFields(dataInput);
    }

    public KPIType getType() {
        return type;
    }

    public void setType(KPIType type) {
        this.type = type;
    }

    public MapWritable getMap() {
        return map;
    }

    public void setMap(MapWritable map) {
        this.map = map;
    }

    @Override
    public KpiType getKPI() {
        return null;
    }
}
